package com.code.day11;

public class Shuzu {

    public  static  void main(String[] args) {
        String str = printArray("=","hello","world","java","java");
        System.out.println(str);
    }
    public static String printArray(String s,String ...arr) {
        String  str = "";
        for (int i = 0; i < arr.length; i++) {
            // 最后一个元素后不添加分隔符
            if (i == arr.length - 1) {
                str += arr[i];
            } else {
                str += arr[i] + s;
            }
        }
        return str;
    }
}
